package com.bourne.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.beans.factory.annotation.Value;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**
 * @PROJECT_NAME: xdclass-1024-shop
 * @DATE: 2021/3/29 19:36
 */
@Data
@ApiModel(value = "用户注册对象", description = "用户注册请求对象")
public class UserRegisterRequest {

    @NotBlank(message = "昵称不能为空")
    @Length(max = 10, min = 3, message = "姓名长度限制3~10字符")
    @ApiModelProperty(value = "昵称", example = "VVS")
    private String name;

    @NotBlank(message = "手机号码不能为空")
    @Length(max = 11, min = 11, message = "手机号格式不正确")
    @ApiModelProperty(value = "手机号", example = "12345678901")
    @Pattern(regexp = "^1[3|4|5|8][0-9]\\d{8}$")
    private String phone;

    @NotBlank(message = "密码不能为空")
    @ApiModelProperty(value = "密码", example = "123456")
    private String pwd;

    @NotBlank(message = "二次密码不能为空")
    @ApiModelProperty(value = "二次密码", example = "123456")
    private String rePwd;

    @NotBlank(message = "验证码不能为空")
    @ApiModelProperty(value = "手机验证码", example = "123456")
    private String code;

}
